<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>v-for</title>
    <script src="js/vuejs-2.5.16.js"></script>


</head>
<body>
<div id="app">
    <!--遍历数组 -->
    <table width="100%" border="1px">
          <!--item  代表 集合遍历元素  in   users 数据模型key -->
             <tr v-for="(item,index) in users">
                 <td>{{index+1}}</td>
                 <td>{{item.name}}</td>
                 <td v-text="item.gender"></td>
                 <td>{{item.age}}</td>
             </tr>
    </table>
</div>

<script>
    var app = new Vue({
        el: "#app",
        data:{
              //  定义数组对象  遍历的数据源   List<User>  name  gender  age  table
            users:[
                {name:'柳岩', gender:'女', age: 20},
                {name:'有哥', gender:'男', age: 30},
                {name:'范冰冰', gender:'女', age: 24},
                {name:'刘亦菲', gender:'女', age: 18},
                {name:'古力娜扎', gender:'女', age: 25}
            ]
        }
    });
</script>

</body>
</html>